package com.zhiyou.mall.controller;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhiyou.mall.model.TextModel;
import com.zhiyou.mall.service.TextService;

@Controller
@RequestMapping("/admin")
public class TextController {
	Logger logger = (Logger) LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
	
	@Autowired
	TextService service;
	
	@RequestMapping(value="index")
	public String index(Model model){
        
		
		
		List<TextModel> list=service.queryTest();
		logger.info("wo shi info log");
		logger.trace("wo shi trace log");
		logger.debug("wo shi debug log");
		System.out.println(list);
		model.addAttribute("list", list);
	
		return "admin/index";
	}

}
